/**
 * @file: file_copy.h
 * @brief: 底层
 * @author: liaowx
 * @date: 2019.08.03
 */
#ifndef __FILE_COPY
#define __FILE_COPY

#include "core.h"

#define FILE_SIZE   (512)
#define FILE_DEST   ("./dest_file.txt")

#define THREADS_COUNT 10
#define THREADS_BUFF_SIZE 512

struct thread_block
{
    /* 源文件句柄 */
    int infd;
    /* 目的文件句柄 */
    int outfd;
    /* 文件的写入起始位置 */
    size_t start;
    /* 文件写入的终止位置 */
    size_t end;
};

struct device {
    char *cmd[CMD_NUM];
    struct core *core[CMD_NUM];
};

extern int normal_copy(char *file_name);
extern int optimize_copy(char *file_name);
struct core *get_dev(void);

#endif